export default {
  functional: true,
  props: {
    opts: () => {}
  },
  mounted() {
    let timer = null
    const timeout = this.opts.timeout || 3000
    timer = setTimeout(() => {
      if (timer) {
        clearTimeout(timer)
      }
    }, timeout)
  },
  render(h, ctx) {
    let { opts } = ctx.props
    return <div className={opts.className + ' customs-message'}>{opts.message}</div>
  }
}
